<?php
$directory = "data/";

if (isset($_POST['action'])&&!empty($_POST['action']))
{
  $action = $_POST['action'];
  $contents = file_get_contents($action);
  echo $contents;
  echo ";";
  $eventfilename = substr($action, 0, -4).".event";
  if (file_exists($eventfilename))
  {
    $contents = file_get_contents($eventfilename);
    echo $contents;
  }
}
else
{
  echo "error";
}
?>